<?php

/**
 * This is the model class for table "t_grpsbk10".
 *
 * The followings are the available columns in table 't_grpsbk10':
 * @property string $THANG
 * @property string $KDDEPT
 * @property string $KDUNIT
 * @property string $KDSBK
 * @property string $KDFUNGSI
 * @property string $KDSFUNG
 * @property string $KDPROGRAM
 * @property string $KDLOKASI
 * @property string $KDKABKOTA
 * @property string $KDGROUP
 * @property string $NMGROUP
 * @property string $KDBIAYA
 * @property integer $ID
 */
class TGrpsbk10 extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return TGrpsbk10 the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 't_grpsbk10';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('THANG, KDSBK', 'length', 'max'=>4),
			array('KDDEPT', 'length', 'max'=>3),
			array('KDUNIT, KDFUNGSI, KDSFUNG, KDPROGRAM, KDLOKASI, KDKABKOTA', 'length', 'max'=>2),
			array('KDGROUP, KDBIAYA', 'length', 'max'=>1),
			array('NMGROUP', 'length', 'max'=>100),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('THANG, KDDEPT, KDUNIT, KDSBK, KDFUNGSI, KDSFUNG, KDPROGRAM, KDLOKASI, KDKABKOTA, KDGROUP, NMGROUP, KDBIAYA, ID', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'THANG' => 'Thang',
			'KDDEPT' => 'Kddept',
			'KDUNIT' => 'Kdunit',
			'KDSBK' => 'Kdsbk',
			'KDFUNGSI' => 'Kdfungsi',
			'KDSFUNG' => 'Kdsfung',
			'KDPROGRAM' => 'Kdprogram',
			'KDLOKASI' => 'Kdlokasi',
			'KDKABKOTA' => 'Kdkabkota',
			'KDGROUP' => 'Kdgroup',
			'NMGROUP' => 'Nmgroup',
			'KDBIAYA' => 'Kdbiaya',
			'ID' => 'ID',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('THANG',$this->THANG,true);
		$criteria->compare('KDDEPT',$this->KDDEPT,true);
		$criteria->compare('KDUNIT',$this->KDUNIT,true);
		$criteria->compare('KDSBK',$this->KDSBK,true);
		$criteria->compare('KDFUNGSI',$this->KDFUNGSI,true);
		$criteria->compare('KDSFUNG',$this->KDSFUNG,true);
		$criteria->compare('KDPROGRAM',$this->KDPROGRAM,true);
		$criteria->compare('KDLOKASI',$this->KDLOKASI,true);
		$criteria->compare('KDKABKOTA',$this->KDKABKOTA,true);
		$criteria->compare('KDGROUP',$this->KDGROUP,true);
		$criteria->compare('NMGROUP',$this->NMGROUP,true);
		$criteria->compare('KDBIAYA',$this->KDBIAYA,true);
		$criteria->compare('ID',$this->ID);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}